const http = require('http')
const options = {
    host: 'localhost',
    port: 3000,
    path: '/user?a=1',
    method: 'POST',
    headers:{
        'content-type':'application/json'
    }
}
http.createServer((request,response)=>{
    const req = http.request(options, (res) => {
        const buffer = []
        res.on('data',(chunk)=>{
            buffer.push(chunk)
        })
        res.on('end',()=>{
            let obj = Buffer.concat(buffer).toString()
            console.log(obj)
            response.end(obj)
        })
    })
    req.end('{"age":123}')
}).listen(3001)
